Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the codebase to migrate from Pydantic v1 to Pydantic v2, adjusting package metadata and configuration across numerous model files and test files.
Changes:
- Updated package name from "cashfree_pg" to "cashfree-pg" and version from "4.5.1" to "1.0.0"
- Migrated Pydantic models from v1 to v2 syntax (model_config, field_validator, Field defaults)
- Removed extraneous blank lines from test files
Reviewed changes
Copilot reviewed 298 out of 551 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| setup.py | Updated package name, version, pydantic dependency to v2, and removed URL |
| pyproject.toml | Updated version and pydantic dependency to v2 |
| configuration.py | Updated SDK package version string |
| test/*.py (27 files) | Removed blank lines for formatting consistency |
| cashfree_pg/models/*.py (200+ files) | Migrated Pydantic v1 to v2 syntax |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| NAME = "cashfree_pg" | ||
| VERSION = "4.5.1" | ||
| NAME = "cashfree-pg" | ||
| VERSION = "1.0.0" |
There was a problem hiding this comment.
The package name change from "cashfree_pg" to "cashfree-pg" is a breaking change. This should be a major version bump, but changing to "1.0.0" suggests a reset. Consider using a version like "5.0.0" to indicate continuation and breaking changes, or document why this is being reset to "1.0.0".
| VERSION = "1.0.0" | |
| VERSION = "5.0.0" # Major version bump to reflect breaking change from 'cashfree_pg' to 'cashfree-pg' |
| author="Cashfree Payments", | ||
| author_email="developers@cashfree.com", | ||
| url="https://cashfree.com", | ||
| url="", |
There was a problem hiding this comment.
The package URL has been removed (empty string). This should either contain a valid URL or be removed entirely from the setup call, as an empty string provides no value and may cause issues with package registries.
| url="", |
| __properties = ["channel", "upi_id", "upi_redirect_url", "upi_expiry_minutes", "authorize_only", "authorization"] | ||
|
|
||
| @validator('channel') | ||
| @field_validator('channel') |
There was a problem hiding this comment.
The field_validator decorator in Pydantic v2 requires mode='after' or mode='before' parameter. Without it, the default is 'after', which may cause validation issues. Add explicit mode parameter: @field_validator('channel', mode='after')
| @field_validator('channel') | |
| @field_validator('channel', mode='after') |
Raising PR to github